const mongoose = require("mongoose")
const bean = require("../bean/menu")
const Model = new mongoose.model("menu",bean)

module.exports = {
  async set(data){
    let model = new Model(data)
    try{
      await model.save()
      return true
    } catch (e) {
      return false
    }
  },
  async get(condition){
    return await Model.find(condition|| {})
  }
}
